package com.vtech.ont.file;

import org.apache.jena.ontology.OntModel;
import org.apache.jena.util.LocationMapper;

/**
 * 本体文件处理服务
 *
 * @author houzhiwei
 * @date 2017 /7/16 15:35
 */
public interface OntFileService {
    /**
     * Open rdf file.
     * OWL_MEM
     *
     * @param filename the filename
     * @return the ont model
     */
    OntModel openRdfFile(String filename);

    /**
     * <pre>
     * Load ont model with location-mapping.ttl.
     * load and process imports
     * </pre>
     *
     * @param locMapperPath the location-mapping.ttl file path. if null, use configured property
     * @param baseOntPath   the base ont path (owl entry file)
     * @return the ont model
     */
    OntModel loadOntModelWithLocMapper(String locMapperPath, String baseOntPath);

    /**
     * Load ont model with configured location-mapper.ttl.
     * config "jena.file.location-mapper" in jena.properties
     *
     * @param baseOntPath the base ont path
     * @return the ont model
     * @see #loadOntModelWithLocMapper(String, String)
     */
    OntModel loadOntModelWithLocMapper(String baseOntPath);

    /**
     * Read location mapping location mapper.
     *
     * @param path the path
     * @return the location mapper
     */
    LocationMapper readLocationMapping(String path);
}
